<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<script>
  //创建标签
  let d = document.createElement("div");
  let c = document.createElement("p");
  d.innerText = "我是div";
  c.innerText = "我是文本";
  //把div添加到body里面
  document.body.appendChild(d);
  document.body.appendChild(c);
  let z = document.createElement("h1");
  z.innerText = "h1我是";
  document.body.append(z,c);
  //append能创建多个，appendChild只能创建一个
  //创建图片
  let i = document.createElement("img");
  i.src = "../b.jpg";
  document.body.append(i);
  let ii = document.createElement("img")
  let aa = document.createElement("hr");
  document.body.append(aa);
</script>
</body>
</html>